 
 
 
 
  
/* Power Concentration and Bottom-up Information Flow  */
/*  Wenhui Yang          				  */
/* 	Dec, 2022                        				  */



 clear
graph drop _all
set matsize 5000
set more off


	
	


***************************************
***Figure 1
***************************************

  use "citydb.dta",clear
  
  
**2002, 
  grmap dual2002 using "city_map.dta" , /// 
       id(id)  fcolor(midgreen*0.2 midgreen) osize(vthin vthin )   ///
	    ndsize(vthin)  ///
	   legend( ring(0) position(4)) legstyle(3)  ///
	   legend(label(3 "Dual Appointment") label(2 "Non-dual Appointment")   size(vsmall)) ///
	   title("2002")
graph save "m1", replace			



	   
**2012	   
  grmap dual2012 using "city_map.dta" , /// 
       id(id)  fcolor(midgreen*0.2 midgreen) osize(vthin vthin )   ///
	    ndsize(vthin)  ///
	   legend( ring(0) position(4)) legstyle(3)  ///
	   legend(label(3 "Dual Appointment") label(2 "Non-dual Appointment")   size(vsmall)) ///
	   title("2012")

graph save "m2", replace			

graph combine m1.gph m2.gph,altshrink scheme(s1mono)	graphregion(fcolor(white))  row(1) 	

erase m1.gph
erase m2.gph





***************************************
***Figure 2
***************************************
**proposal

  grmap aver_proposal using "city_map.dta" , /// 
  id(id)  fcolor(green*0.1 green*0.4 green*0.5 green*0.7 green) osize(vvthin vvthin vvthin vvthin vvthin vvthin)   ///
	  clmethod(custom)  clbreaks(20 50 100 200 1000)  ndsize(vvthin)  ///
	   legend( ring(1) position(4)) legstyle(3)  
	   
	   
	   
	   

	
	
	

***************************************
***Figure 3
***************************************
use "legislature_202209.dta"

	
	sort prefid year
    xtset prefid year

quietly xtreg appoint concentration age gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp protestall i.year if tenure==1,fe cluster(prefid)
	estimates store A1
quietly xtreg appoint concentration age gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp protestall i.year if tenure==2,fe cluster(prefid)
	estimates store A2
quietly xtreg appoint concentration age gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp protestall i.year if tenure==3,fe cluster(prefid)
     estimates store A3
quietly xtreg appoint concentration age gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp protestall i.year if tenure==4,fe cluster(prefid)
	estimates store A4
quietly xtreg appoint concentration age gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp protestall i.year if tenure==5,fe cluster(prefid)
	estimates store A5

	
		  
coefplot A1 A2 A3 A4 A5,  ci(95) msymbol(O) aseq swapnames  mcolor(black) lpatt(solid) lcol(black) lwidth(vvthin)  ciopts(lpatt(solid) lcol(black)) ///
          keep(concentration)   yline(0, lpatt(dash) lcol(black))   ytitle("Dual Appointment on the Appointment and Removal of Officials", height(5) size(small)) ///		 
           vertical graphregion(fcolor(white)) bfcolor(none)  leg(off) ///
		   ylabel(, nogrid angle(vertical) labsize(small))   ylabel(-60(20)60) coeflabels(*A1* = "Year 1" *A2* = "Year 2" *A3* = "Year 3" *A4* = "Year 4" *A5* = "Year 5")   
	

	
	
***************************************
***Table 1 main result:full results
***************************************

use "legislature_202209.dta"

	
	sort prefid year
    xtset prefid year

xtreg proposal concentration i.year,fe cluster(prefid)
	eststo 
xtreg proposal concentration age tenure gender ethnic edu_graduate homecity i.year,fe cluster(prefid)
	 eststo 
xtreg proposal concentration age tenure gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp calender protestall i.year,fe cluster(prefid)
	 eststo 
xtreg perproposal concentration i.year,fe cluster(prefid)
	eststo 
xtreg perproposal concentration age tenure gender ethnic edu_graduate homecity i.year,fe cluster(prefid)
	eststo 
xtreg perproposal concentration age tenure gender ethnic edu_graduate homecity logpopulation logrevenue logpgdp calender protestall i.year,fe cluster(prefid)
	eststo 
esttab,   keep(concentration ) se(3) b(3) star(* .1 ** .05 *** .01) tex r2
    eststo clear
	
	


	
***************************************
***	Table 2 power centration, age and Proposal
***************************************
use "legislature_202209.dta",clear

xtreg proposal i.concentration##i.age50 i.year,fe cluster(prefid)
	eststo 
xtreg proposal i.concentration##i.age50 tenure gender ethnic edu_graduate homecity i.year,fe cluster(prefid)
	 eststo 
xtreg proposal i.concentration##i.age50 tenure gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp calender protestall i.year,fe cluster(prefid)
	 eststo 
xtreg perproposal i.concentration##i.age50 i.year,fe cluster(prefid)
	eststo 
xtreg  perproposal i.concentration##i.age50 tenure gender ethnic edu_graduate homecity i.year,fe cluster(prefid)
	eststo 
xtreg  perproposal i.concentration##i.age50 tenure gender ethnic edu_graduate homecity logpopulation logrevenue logpgdp calender  protestall i.year,fe cluster(prefid)
	eststo 
esttab,   keep(1.concentration#1.age50 1.concentration 1.age50 tenure gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp calender  protestall) order(1.concentration#1.age50 1.concentration 1.age50 tenure gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp  protestall) se(3) b(3) star(* .1 ** .05 *** .01) tex r2
    eststo clear

	
	

	
	
***************************************
***Table 3	power centration, retried PS and Proposal
***************************************

use "legislature_202209.dta",clear
xtreg proposal  retire_ps i.year if concentration==0,fe cluster(prefid)
	eststo 
xtreg proposal retire_ps age tenure gender ethnic edu_graduate homecity i.year if concentration==0,fe cluster(prefid)
	 eststo 
xtreg proposal retire_ps age tenure gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp calender protestall i.year if concentration==0,fe cluster(prefid)
	 eststo 
xtreg perproposal retire_ps i.year if concentration==0,fe cluster(prefid)
	eststo 
xtreg  perproposal retire_ps  age tenure gender ethnic edu_graduate homecity i.year if concentration==0,fe cluster(prefid)
	eststo 
xtreg  perproposal retire_ps age tenure gender ethnic edu_graduate homecity logpopulation logrevenue logpgdp calender protestall i.year if concentration==0,fe cluster(prefid)
	eststo 
esttab,   keep(retire_ps age tenure gender edu_graduate ethnic  homecity logpopulation logrevenue logpgdp calender protestall) se(3) b(3) star(* .1 ** .05 *** .01) tex r2
    eststo clear
	


	

	
***************************************
***Table 4 Concentration and protest and petition
***************************************
use "legislature_202209.dta",clear
	
xtreg logpetition concentration i.year,fe cluster(prefid)
	eststo 
xtreg logpetition concentration age tenure gender ethnic edu_graduate homecity i.year,fe cluster(prefid)
	 eststo 
xtreg logpetition concentration age tenure gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp calender protestall i.year,fe cluster(prefid)
	 eststo 

xtreg protest concentration i.year,fe cluster(prefid)
	eststo 
xtreg protest concentration age tenure gender ethnic edu_graduate homecity i.year,fe cluster(prefid)
	 eststo 
xtreg protest concentration age tenure gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp calender  i.year,fe cluster(prefid)
	 eststo 

esttab,   keep(concentration age tenure gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp calender protestall) se(3) b(3) star(* .1 ** .05 *** .01) tex r2
    eststo clear
	
	
	
	
	
***************************************
***Table 5
***************************************

use "legislature_202209.dta",clear
/*
gen post=0

replace post=1 if tenure>=3&year==2003&tenure!=.
replace post=1 if tenure>=4&year==2004&tenure!=.
replace post=1 if tenure>=5&year==2005&tenure!=.
replace post=1 if tenure>=6&year==2006&tenure!=.
replace post=1 if tenure>=7&year==2007&tenure!=.
replace post=1 if tenure>=8&year==2008&tenure!=.
replace post=1 if tenure>=9&year==2009&tenure!=.
replace post=1 if tenure>=10&year==2010&tenure!=.
replace post=1 if tenure>=11&year==2011&tenure!=.
replace post=1 if tenure>=12&year==2012&tenure!=.


replace post=1 if tenure>=3&year==2008&tenure!=.
replace post=1 if tenure>=4&year==2009&tenure!=.
replace post=1 if tenure>=5&year==2010&tenure!=.
replace post=1 if tenure>=6&year==2011&tenure!=.
replace post=1 if tenure>=7&year==2012&tenure!=.  */



*gen yesman=concentration*post


xtreg proposal yesman  i.year,fe cluster(prefid)
	eststo 
xtreg proposal yesman   age gender ethnic edu_graduate homecity i.year,fe cluster(prefid)
	 eststo 
xtreg proposal  yesman   age  gender ethnic edu_graduate  homecity logpopulation logrevenue logpgdp protestall i.year,fe cluster(prefid)
	 eststo 
xtreg perproposal yesman   i.year,fe cluster(prefid)
	eststo 
xtreg perproposal  yesman   age gender ethnic edu_graduate homecity i.year,fe cluster(prefid)
	eststo 
xtreg perproposal yesman  age gender ethnic edu_graduate homecity logpopulation logrevenue logpgdp protestall i.year,fe cluster(prefid)
	eststo 
esttab, keep(yesman gender ethnic edu_graduate homecity logpopulation logrevenue logpgdp protestall )  se(3) b(3) star(* .1 ** .05 *** .01) r2 tex
    eststo clear
	
	
	

	




			  
			  
	
	